///**
// * Copyright (c) 2018 人人开源 All rights reserved.
// * <p>
// * https://www.renren.io
// * <p>
// * 版权所有，侵权必究！
// */
//
//package io.renren.controller;
//
//import cn.hutool.crypto.digest.DigestUtil;
//import io.renren.common.utils.Result;
//import io.renren.common.validator.ValidatorUtils;
//import io.renren.dto.RegisterDTO;
//import io.renren.entity.UserEntity;
//import io.renren.service.UserService;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import lombok.AllArgsConstructor;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import java.util.Date;
//
///**
// * 注册接口
// *
// * @author Mark sunlightcs@gmail.com
// */
//@RestController
//@RequestMapping("/api")
//@Api(tags = "注册接口")
//@AllArgsConstructor
//public class ApiRegisterController {
//    private final UserService userService;
//
//    @PostMapping("register")
//    @ApiOperation("注册")
//    public Result register(@RequestBody RegisterDTO dto) {
//        //表单校验
//        ValidatorUtils.validateEntity(dto);
//
//        UserEntity user = new UserEntity();
//        user.setMobile(dto.getMobile());
//        user.setUsername(dto.getMobile());
//        user.setPassword(DigestUtil.sha256Hex(dto.getPassword()));
//        user.setCreateDate(new Date());
//        userService.insert(user);
//
//        return new Result();
//    }
//}